// 泛型

function sum<Type extends number>(num1: Type): Type {
  return num1
}

// 接收多个参数
function foo<T, E>(arg1: T, arg2: E) {
  return arg1
}

foo<number, string>(10, '12')


// 泛型接口

interface IPerson<T, E> {
  name: T,
  age: E
}

const p: IPerson<string, number> = {
  name: 'why',
  age: 18
}

// 泛型类
class Point<T> {
  x: T
  y: T
  z: T

  constructor(x: T, y: T, z: T) {
    this.x = x
    this.y = y
    this.z = z
  }
}




export { }